package com.atguigu.gmall.item.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author: 封捷
 * @create-date: 2022/8/29 10:44
 */
@Configuration
public class ThreadPoolConfig {

    @Bean
    public ThreadPoolExecutor getPoolExecutor() {
        return new ThreadPoolExecutor(
                10,
                50,
                30,
                TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(100));
    }

}
